import getThemeColor from '@/utils/themesColor'

export default {
  container: '',
  width: 0,
  height: 0,
  fitView: true,
  // fitViewPadding: [20, 40, 50, 20],
  // layout: {
  //   type: 'force2',
  //   preventOverlap: true,
  //   linkDistance: 200
  // },
  groupByTypes: false,
  modes: {
    default: [
      {
        type: 'drag-canvas',
        enableOptimize: false,
        allowDragOnItem: true
      },
      {
        type: 'zoom-canvas',
        enableOptimize: false
      },
      {
        type: 'click-select',
        selectCombo: false
      }
    ],
    edit: [
      'drag-canvas',
      'zoom-canvas',
      'drag-combo',
      'brush-select',
      {
        type: 'drag-node',
        onlyChangeComboSize: true
      }
    ]
  },
  defaultNode: {
    size: 45,
    style: {
      cursor: 'pointer'
    },
    labelCfg: {
      position: 'bottom',
      style: {
        fontSize: 16
        // stroke: '#fff',
        // lineWidth: 1
      }
    }
  },
  defaultEdge: {
    // type: 'quadratic', // 设置边为贝塞尔曲线
    style: {
      cursor: 'pointer',
      lineWidth: 2,
      lineAppendWidth: 4
    },
    labelCfg: {
      refY: 30,
      autoRotate: true, // 设置标签文字跟随边旋转
      style: {
        opacity: 0
      }
    }
  },
  defaultCombo: {
    type: 'rect',
    padding: [30, 30, 30, 30],
    labelCfg: {
      style: {
        fill: getThemeColor('unifiedFontColor'),
        fontSize: 18
      }
    }
  },
  nodeStateStyles: {
    hover: {
      size: 80
    }
  },
  edgeStateStyles: {
    click: {
      stroke: 'steelblue'
    }
  }
}
